package com.spring.demos.ioccontainer.pojo;

public class PhoneFactory {
    public PhoneFactory() {

    }

    public Phone getPhoneInstance(String phoneType){
        if(phoneType.equalsIgnoreCase("iphone")){

            return new Iphone("高通IV","iphone11",5200.0f);

        }else if(phoneType.equalsIgnoreCase("huawei")){

            return new HuaweiPhone("麒麟VII","华为p30",3100.0f);
        }

        return  new XiaomiPhone("高通III","小米8",2400.0f);
    }

}
